package com.wn.cloud.common.exception;

import com.wn.cloud.common.constant.ResponseEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @FileName: GlobalException
 * @Description: TODO
 * @Author: MaWenHao
 * @Created: 2020/3/8 - 1:07
 * @Version: V1.0
 * @Company: 东方微银科技（北京）有限公司
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class GlobalException extends RuntimeException {

    private ResponseEnum responseEnum;

    /**
     * Returns the detail message string of this throwable.
     *
     * @return the detail message string of this {@code Throwable} instance
     * (which may be {@code null}).
     */
    @Override
    public String getMessage() {
        return responseEnum.getMessage();
    }
}
